<?php

namespace module\index\controller;

use app\Controller;
use app\model\User as Model;
use app\model\Activity;
use app\model\UserAddress;
use app\model\Coupon;
use app\model\City;

class Me extends Controller
{
    /**
     * 详情.
     * 
     */
    public function index()
    {
        $model = Model::scope('user')->findOrFail();
        return json($model->toArray());
    }
    /**
     * 更新.
     */
    public function update()
    {
        $model = Model::scope('user')->findOrFail();
        $model->save($this->request->put());
        return json($model->tpoArray());
    }
    /**
     * 删除.
     * 
     */
    public function del()
    {
        $model = Model::scope('user')->findOrFail();
        $model->delete();
        return json($model->toArray());
    }
}


